#!/bin/bash

if [ $# -ne 1 ] ; then 
  echo "Error: expected input file";
  echo "Usage: avr-load <filename>"; 
  exit; 
fi;

avr-objcopy -O ihex -R .eeprom $1 /tmp/temp.hex ;
bootloadHID -r /tmp/temp.hex ;
rm /tmp/temp.hex
